import { request } from '../request';

/** 获取角色列表 */
export const getRoleList = async (params: any) => {
  const data = await request.post<any>('/admin/Role/roleList', params);
  return data;
};

/** 添加角色 */
export const addRole = async (params: any) => {
  const data = await request.post<any>('/admin/Role/addRole', params);
  return data;
};

/** 修改角色操作 */
export const updateRole = async (params: any) => {
  const data = await request.post<any>('/admin/Role/updateRole', params);
  return data;
};

/** 查角色 */
export const updateRoleById = async (id: any) => {
  const data = await request.get<any>(`/admin/Role/updateRole/id/${id}`);
  return data;
};

/** 获取推广用户列表 */
export const getOperatorList = async (params: any) => {
  const data = await request.post<any>('/admin/Operator/operatorList', params);
  return data;
};

/** 添加推广用户 */
export const addOperator = async (params: any) => {
  const data = await request.post<any>('/admin/Operator/addOperator', params);
  return data;
};

/** 修改推广用户 */
export const updateOperator = async (params: any) => {
  const data = await request.post<any>('/admin/Operator/updateOperator', params);
  return data;
};

/** 查推广用户 */
export const updateOperatorById = async (id: any) => {
  const data = await request.get<any>(`/admin/Operator/updateOperator/id/${id}`);
  return data;
};
